Repository navigation
Don't use hardcoded AMD64 architecture for paths - #350
Merged
Merged
Conversation
Signed-off-by: John McCrae <john.mccrae@progress.com>
Signed-off-by: John McCrae <john.mccrae@progress.com>
Signed-off-by: John McCrae <john.mccrae@progress.com>
There was a problem hiding this comment.
Pull Request Overview
This PR addresses a hardcoded architecture value ("AMD64") throughout the codebase by replacing it with dynamic architecture detection using the PROCESSOR_ARCHITECTURE environment variable. The changes ensure proper support for different processor architectures while maintaining backward compatibility by defaulting to "AMD64" when the environment variable is not set.
Key Changes:
- Replaced hardcoded "AMD64" strings with dynamic architecture detection using
ENV["PROCESSOR_ARCHITECTURE"] || "AMD64" - Added null checks for
Gem.loaded_specs["chef-powershell"]to prevent potential nil reference errors - Updated build scripts and workflows to use dynamic architecture paths
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| chef-powershell/spec/unit/powershell_exec_spec.rb | Added gem spec null check and dynamic architecture detection in test setup |
| chef-powershell/lib/chef-powershell/pwsh.rb | Replaced hardcoded AMD64 with dynamic arch detection in multiple locations, added gem spec validation |
| chef-powershell/lib/chef-powershell/powershell_exec.rb | Updated path construction to use dynamic architecture with null safety |
| chef-powershell/ext/chef-powershell/extconf.rb | Modified DLL search paths and log messages to use dynamic architecture |
| Rakefile | Updated rake task to use dynamic architecture for target directory |
| .github/workflows/manual-gem-build.yml | Added dynamic architecture detection in PowerShell workflow |
| .github/workflows/gem-build.yml | Added dynamic architecture detection in PowerShell workflow |
| .expeditor/manual_gem_release.ps1 | Updated release script to use dynamic architecture |
| .expeditor/build_gems.ps1 | Updated build script to use dynamic architecture |
| chef-powershell/chef_dictionary.txt | Added new dictionary entries (unrelated to architecture changes) |
tpowell-progress
approved these changes
Oct 31, 2025
Signed-off-by: John McCrae <john.mccrae@progress.com>
Signed-off-by: John McCrae <john.mccrae@progress.com>
11 tasks
johnmccrae
added a commit
that referenced
this pull request
Sep 2, 2026
Cherry-picked build-script portion of 18-Stable commit 234b838 (#350): - build_gems.ps1 / manual_gem_release.ps1 resolve PROCESSOR_ARCHITECTURE dynamically instead of hardcoding AMD64 - update_version.ps1 resolves project root via 'git rev-parse --show-toplevel' instead of a full C:\ recursive scan The Ruby runtime portion of 234b838 is not included since main's ChefPowerShell.bin_dir already supersedes it. Signed-off-by: John McCrae <mccrae@progress.com>
johnmccrae
added a commit
that referenced
this pull request
Sep 4, 2026
Cherry-picked build-script portion of 18-Stable commit 234b838 (#350): - build_gems.ps1 / manual_gem_release.ps1 resolve PROCESSOR_ARCHITECTURE dynamically instead of hardcoding AMD64 - update_version.ps1 resolves project root via 'git rev-parse --show-toplevel' instead of a full C:\ recursive scan The Ruby runtime portion of 234b838 is not included since main's ChefPowerShell.bin_dir already supersedes it. Signed-off-by: John McCrae <mccrae@progress.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The initial #349 PR cleaned up a lot of problems with the chef-powershell build, but retained the practice of using hardcoded architecture paths (which at the moment is only AMD64). This PR is intended to future proof the code by retrieving the architecture dynamically (but still falls back on AMD64).
Related Issue
Types of changes
Checklist:
Gemfile.lockhas changed, I have used--conservativeto do it and included the full output in the Description above.